#ifndef SERVER_MANAGER_H
#define SERVER_MANAGER_H

#include "../server/IPythonBindServer.h"
#include <QObject>
#include <QSharedPointer>

class PythonBindServer;

class ServerManager {
public:
  /**
   * @brief 获取ServerManager单例实例
   * @return ServerManager实例的引用
   */
  static ServerManager &getInstance();

  /**
   * @brief 创建并获取IPythonBindServer实例
   * @return QSharedPointer<IPythonBindServer> 共享指针
   */
  QSharedPointer<IPythonBindServer> createPythonBindServer();

  /**
   * @brief 获取默认的IPythonBindServer实例
   * @return QSharedPointer<IPythonBindServer> 共享指针
   */
  QSharedPointer<IPythonBindServer> getDefaultPythonBindServer();

private:
  /**
   * @brief 私有构造函数
   */
  ServerManager();

  /**
   * @brief 私有析构函数
   */
  ~ServerManager();

  // 禁止拷贝
  ServerManager(const ServerManager &) = delete;
  ServerManager &operator=(const ServerManager &) = delete;

  // 默认PythonBindServer实例
  QSharedPointer<IPythonBindServer> m_defaultServer;
};

#endif // SERVER_MANAGER_H